<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../node_modules/vue/dist/vue.global.js"></script>
</head>

<body>
    <div id="app">
        <p @click="add" v-once>{{count}}</p>
    </div>
</body>

</html>
<script>
    // v-once: 只渲染一次,数据将失去响应式的特点

    const app = Vue.createApp({
        data() {
            return {
                count: 100
            }
        },
        methods: {
            add() {
                this.count++
            }
        }
    }).mount('#app')

</script>